var baseUrl="https://music.aityp.com/"
function http({url,data,success}){
    return new Promise((resolve,reject)=>{
        wx.request({
            url: baseUrl+url,
            data: {},
            header: {'content-type':'application/json'},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: (res)=>{
                success(res);
            }
        });
    })
}
module.exports={
    getMusicData:(callback)=>{
        http({
            url:'top/playlist?cat=华语&limit=15',
            success:res=>{
                callback(res)
            }
        })
    },
    getMusicContent:(id,callback)=>{
        http({
            url:`playlist/detail?id=${id}`,
            success:res=>{
                callback(res);
            }
        })
    }
}